import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/generated/res_upload_oil_entity.dart';

ResUploadOilEntity $ResUploadOilEntityFromJson(Map<String, dynamic> json) {
  final ResUploadOilEntity resUploadOilEntity = ResUploadOilEntity();
  final String? energyOrderCode = jsonConvert.convert<String>(json['energyOrderCode']);
  if (energyOrderCode != null) {
    resUploadOilEntity.energyOrderCode = energyOrderCode;
  }
  final String? energyOrderId = jsonConvert.convert<String>(json['energyOrderId']);
  if (energyOrderId != null) {
    resUploadOilEntity.energyOrderId = energyOrderId;
  }
  final String? suspendTime = jsonConvert.convert<String>(json['suspendTime']);
  if (suspendTime != null) {
    resUploadOilEntity.suspendTime = suspendTime;
  }
  final int? energyOrderStatus = jsonConvert.convert<int>(json['energyOrderStatus']);
  if (energyOrderStatus != null) {
    resUploadOilEntity.energyOrderStatus = energyOrderStatus;
  }
  return resUploadOilEntity;
}

Map<String, dynamic> $ResUploadOilEntityToJson(ResUploadOilEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['energyOrderCode'] = entity.energyOrderCode;
  data['energyOrderId'] = entity.energyOrderId;
  data['suspendTime'] = entity.suspendTime;
  data['energyOrderStatus'] = entity.energyOrderStatus;
  return data;
}

extension ResUploadOilEntityExtension on ResUploadOilEntity {
  ResUploadOilEntity copyWith({
    String? energyOrderCode,
    String? energyOrderId,
    String? suspendTime,
    int? energyOrderStatus,
  }) {
    return ResUploadOilEntity()
      ..energyOrderCode = energyOrderCode ?? this.energyOrderCode
      ..energyOrderId = energyOrderId ?? this.energyOrderId
      ..suspendTime = suspendTime ?? this.suspendTime
      ..energyOrderStatus = energyOrderStatus ?? this.energyOrderStatus;
  }
}